using UnityEngine;
using System.Collections;
using DICE_GS;

public class CPawnWrapper : MonoBehaviour
{

    delegate void EventHandlerForStageManagerWrapper(string msg);
    private BoardPerson m_person = null;

    private CPawn instance = null;

    bool bCanCombatRoll = false;

    public CPawn Instance
    {
        get
        {
            return instance;
        }
        set
        {
            this.instance = value;
        }
    }

    public BoardPerson BoardPerson
    {
        get
        {
            return m_person;
        }
        set
        {
            this.m_person = value;
        }
    }

    public bool CanCombatRoll
    {
        get
        {
            return bCanCombatRoll;
        }
        set
        {
            this.bCanCombatRoll = value;
        }
    }

    public int SID
    {
        get
        {
            if (instance != null)
            {
                return this.instance.SID;
            }
            else
            {
                return -1;
            }
        }
    }
	
	public void CombatRoll()
	{
		if(CanCombatRoll)
		{
            PC_CS_ROLL_DICE packet = new PC_CS_ROLL_DICE();
	
	        packet.ServerID = SID;
	        packet.DiceType = (byte)DiceType.DICE_COMBAT;
	
	        //CNetworkManager.Instance.SendPacket(packet.Protocol, packet.GetParam());
			CNetworkManager.Instance.SendPacket(packet);
	        CanCombatRoll = false;
		}
	}

}
